home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.2 for Intel / NeXTSTEP 3.2 for Intel.iso / NextLibrary / Documentation / Sybase / DBLIB / Section2 / dbgetchar.nr < prev    next >
Encoding:
Text File  |  1993-04-22  |  1.4 KB  |  57 lines

  1. .Na "dbgetchar" 
  2. .Aa
  3. .Fu
  4. Return a pointer to a character in the command buffer.
  5. .Ih "command buffer, returning a character in"
  6. .Sy
  7. .Sf "char *dbgetchar(dbproc, n)"
  8. .Sp "DBPROCESS" "*dbproc"
  9. .Sp "int" "n"
  10. .Co
  11. .Bl
  12. You can use
  13. .I "dbgetchar()"
  14. to find a particular character in the command buffer.
  15. It returns a pointer to the \f2n\f1'th character in the command
  16. buffer.
  17. .Bl
  18. Internally,
  19. the command buffer is a linked list of non-null-terminated text strings.
  20. .I "dbgetchar(), dbstrcpy(),"
  21. and
  22. .I "dbstrlen()"
  23. together provide a way to locate and copy parts of the command buffer.
  24. .Bl
  25. Since the command buffer is not just one large text string, but rather a
  26. linked list of text strings, you must use
  27. .I "dbgetchar()"
  28. to index through the buffer.
  29. If you just get a pointer using
  30. .I "dbgetchar()"
  31. and then increment it yourself, it will probably fall off the end of a string
  32. and cause a segmentation fault.
  33. .Bz
  34. .Pa
  35. .Pi dbproc
  36. A pointer to the DBPROCESS structure that provides the connection
  37. for a particular front-end/\*S process.  It contains all the
  38. information that \*L uses to manage communications and data between the
  39. front end and \*S.
  40. .Pi n
  41. The character to find in the command buffer.
  42. The first character is the 0'th character.
  43. .in -.375i
  44. .Re
  45. .br
  46. .I "dbgetchar()"
  47. returns a pointer to the \f2n\f1'th character in the command buffer.
  48. If
  49. .I n
  50. is not in range, \f2dbgetchar()\f1 returns NULL.
  51. .Sa
  52. dbcmd,
  53. dbfcmd,
  54. dbfreebuf,
  55. dbstrcpy,
  56. dbstrlen
  57.